package com.lagou.config;

import com.github.pagehelper.PageInterceptor;
import org.apache.ibatis.plugin.Interceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 * @Description:
 * @Author: zhoushiduo
 * @Date: 2020/12/13 15:45
 */

@Configuration
public class MyBatisConf {

    @Bean
    public Interceptor createInterceptor(){
        PageInterceptor pageHelper = new PageInterceptor();
        Properties properties = new Properties();
//        properties.setProperty("dialect","mysql");
//        properties.setProperty("offsetAsPageNum","true");
        pageHelper.setProperties(properties);
        return pageHelper;
    }
}
